package com.layne.controller;


import com.layne.pojo.User;
import com.layne.service.IOrderService;
import com.layne.vo.OrderDetailVo;
import com.layne.vo.RespBean;
import com.layne.vo.RespBeanEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

/**
 *
 * @author layne
 */
@Controller
@RequestMapping("/order")
public class OrderController {


    @Autowired
    private IOrderService orderService;


    @RequestMapping( "/detail")
    @ResponseBody
    public RespBean detail(User user, Long orderId) {
        if (user == null) {
            return RespBean.error(RespBeanEnum.SESSION_ERROR);
        }
        OrderDetailVo detail = orderService.detail(orderId);
        return RespBean.success(detail);
    }

//    @RequestMapping("/pay")
//    @ResponseBody
//    public RespBean pay(User user,Long orderId){
//        OrderDetailVo detail = orderService.detail(orderId);
//        System.out.println(orderId);
//        System.out.println("111");
//        return RespBean.success(detail);
//    }

}
